<!-- 薪酬管理 -->
<template>
	<view class="p-3">
		<bg-bignav class="my-3" @click="goto(nav)"  v-for="nav in navs" :key="nav.bg" :bg="nav.bg" :icon="nav.icon">
			{{nav.name}}
		</bg-bignav>
	</view>
</template>

<script>
	export default {
		mounted() {
			if(this.$auth.hasRole("project")||this.$auth.hasRole("team")){
				this.navs[0].url="/pages/salary/borrow/index-leader"
			}
		},
		data() {
			return {
				navs:[
					{name:"借支申请", bg:'orange', icon:"1", url:"/pages/salary/borrow/index-user"}, //todo 角色判断
					{name:"工资申请", bg:'blue', icon:"2", url:"/pages/salary/salary/index"},
					{name:"退场结算", bg:'sky', icon:"4", url:"/pages/salary/settlement/index"},
					{name:"退场申请", bg:'yellow', icon:"3", url:"/pages/salary/retire/index"},
				]
			}
		},
		methods: {
			goto(nav){
				if(this.$store.state.user.userInfo.authStatus==1){
					if(this.$auth.hasPermi(nav.name)){
						uni.navigateTo({
							url:nav.url
						})
					} else {
						this.$modal.msg("您当前暂无权限")
					}
				}else {
					this.$modal.confirm("请先进行实名认证", false).then(res=>{
						uni.navigateTo({
							url:'/pages/enter/verify/new'
						})
					})
				}
			
			}
		}
	}
</script>

<style scoped>
	
</style>
